<layout name ="Index/common" />
<div class="banner banner2">
	<div class="container">
		<div class="headr-right">
				<div class="details">
					<ul>
						<li><a href="mailto:mr.reboot@qq.com"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>info(at)Mr.Reboot</a></li>
						<li><span class="glyphicon glyphicon-earphone" aria-hidden="true"></span>(+86)177 3975 2367</li>
					</ul>
			  </div>
		</div>
		<div class="banner_head_top">
			  <div class="logo">
					<h1><a href="__ROOT__/">Mr.Reboot<span class="glyphicon glyphicon-knight" aria-hidden="true"></span><span>Blog</span></a></h1>
			</div>
			<div class="top-menu">
				<div class="content white">
					<nav class="navbar navbar-default">
						<div class="navbar-header">
							<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
								<span class="sr-only">Toggle navigation</span>
								<span class="icon-bar"></span>
								<span class="icon-bar"></span>
								<span class="icon-bar"></span>
							</button>
						</div>
						<!--/navbar header-->
						<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
							<ul class="nav navbar-nav">
								<li><a href="__ROOT__/">首页</a></li>
								<li class="dropdown active">
									<a href="#" class="scroll dropdown-toggle" data-toggle="dropdown">博客<b class="caret"></b></a>
									<ul class="dropdown-menu">
										<li><a href="__ROOT__/index/listArt">全部文章</a></li>
										<foreach name='cate' item='ct'>
											<li><a href="__ROOT__/index/listArt/cateid/{$ct.id}">{$ct.cate}</a></li>
										</foreach>
									</ul>
								</li>
								<li><a href="__ROOT__/index/msg.html">留言反馈</a></li>
								<li><a href="__ROOT__/index/about.html">关于本站</a></li>
							</ul>
							</div>
						  <!--/navbar collapse-->
					</nav>
					  <!--/navbar-->
				</div>
					<div class="clearfix"></div>
					<script type="text/javascript" src="__HOME__/js/bootstrap-3.1.1.min.js"></script>
			  </div>
				<div class="clearfix"></div>
		  </div>
	</div>
</div>
<!---->
<div class="container">
	<div class="single">
		<div class="blog-to">
			<img class="img-responsive sin-on" src="__ROOT__/{$blogId.bigimg}" alt="" />
			<div class="blog-top">
				<div class="blog-left">
					<b>{$blogId.creattime|date='m-d',###}</b>
				</div>
				<div class="top-blog">
					<a class="fast">{$blogId.title}</a>
					<p>
						作者：
						<a>{$blogId.author}</a>&nbsp;&nbsp;
						<img src="__HOME__/images/sep.gif" alt="" />&nbsp;&nbsp;
						<img src="__HOME__/images/icon-time.png" alt="" />&nbsp;更新时间：{$blogId.updatetime|date='Y-m-d H:i:s',###}&nbsp;&nbsp;
						<img src="__HOME__/images/sep.gif" alt="" />&nbsp;&nbsp;
						<img src="__HOME__/images/icon-category.png" alt="" />&nbsp;点击量：<span class="badge badge-danger">{$blogId.hits}</span>&nbsp;&nbsp;</p>
					<br>
					<div class="clearfix">{$blogId.content}</div>
				</div>
				<div class="clearfix"> </div>
			</div>
		</div>
		<div class="single-middle">
			<h3>评论列表</h3>
			<if condition='$comt eq null'>
				<h4>暂无评论</h4>
			<else/>
				<foreach name="comt" item="comtk">
					<div class="media">
						<div class="media-left">
							<a><img class="media-object" src="__HOME__/images/co.jpg" alt=""></a>
						</div>
						<div class="media-body">
							<h4 class="media-heading">
								<strong>{$comtk.name}</strong>
								<span style="float: right;font-size: 14px;">
									<img src="__HOME__/images/icon-time.png" alt="" />&nbsp;时间：{$comtk.time|date='Y-m-d H:i:s',###}
								</span>
							</h4>
							<p>
								{$comtk.comment}
								<a href="javascript:void(0)" class="label label-info" onclick="reply({$comtk.id},'{$comtk.name}')"  style="float: right; font-size: 16px;">
									<img src="__HOME__/images/icon-mail.png" alt="" />&nbsp;回复
								</a>
							</p>
						</div>
					</div>
					<foreach name="reply" item="re">
						<if condition='$re["comtid"] eq $comtk["id"]'>
							<div class="media in-media">
								<div class="media-left">
									<a><img class="media-object" src="__HOME__/images/co.jpg" alt=""></a>
								</div>
								<div class="media-body">
									<h4 class="media-heading">
										<strong>{$re.name}</strong>
										<span style="color: #8A08C0">回复</span>
										<strong>{$re.toname}</strong>
										<span style="float: right;font-size: 14px;">
											<img src="__HOME__/images/icon-time.png" alt="" />&nbsp;时间：{$re.time|date='Y-m-d H:i:s',###}
										</span>
									</h4>
									<p>
										{$re.comment}
										<a href="javascript:void(0)" class="label label-info" onclick="reply({$comtk.id},'{$re.name}')"  style="float: right; font-size: 16px;">
											<img src="__HOME__/images/icon-mail.png" alt="" />&nbsp;回复
										</a>
									</p>
								</div>
							</div>
						</if>
					</foreach>
				</foreach>
			</if>
		</div>
		<!---->
		<div class="single-bottom">
			<h3>发表评论</h3>
			<form action="__ROOT__/comment/addComment" method="post">
				<input type="hidden" name="toart" value="{$blogId.id}">
				<div class="col-md-4 comment">
					<input type="text" placeholder="姓名" name="name">
				</div>
				<div class="col-md-8 comment">
					<input type="text" placeholder="邮箱" name="email">
				</div>
				<div class="clearfix"> </div>
				<textarea cols="77" rows="6" placeholder="留言内容" name="comment"></textarea>
				<input type="submit" value="Send" >
			</form>
		</div>
	</div>
</div>
<div id="reply" style="display: none; text-align: center;">
	<div style="margin:100px auto; width: 500px; height: 400px;background-color:#FFF;border: 1px solid #000; padding: 20px 50px;"  class="templatemo-content-widget white-bg col-1 text-center templatemo-position-relative">
		<h3 class="bars">Forms</h3>
		<form action="__ROOT__/comment/addComment" method="post">
			<input type="hidden" name="comtId" value="">
			<input type="hidden" name="toname" value="">
			<input type="hidden" name="toart" value="{$blogId.id}">
			<div class="input-group">
				<span class="input-group-addon" id="basic-addon1">姓名</span>
				<input type="text" class="form-control" aria-describedby="basic-addon1" name="name">
			</div>
			<div class="input-group">
				<span class="input-group-addon" id="basic-addon1">邮箱</span>
				<input type="email" class="form-control" aria-describedby="basic-addon1" name="email">
			</div>
			<div class="input-group">
				<span class="input-group-addon" id="basic-addon1">内容</span>
				<textarea class="form-control" aria-describedby="basic-addon1" name="comment"></textarea>
			</div>
			<div class="input-group input-group-lg">
				<input type="text" class="form-control" placeholder="输入验证码" aria-describedby="basic-addon2" name="verify">
				<span class="input-group-btn">
					<a href="javascript:void(0)" onclick="document.getElementById('verify1').src='{:U(\'admin/getVerification\')}?r='+Math.random()">
						<img id="verify1" src="{:U('admin/getVerification')}">
					</a>
				</span>
			</div>
			<input name="submit" type="submit" class="label-success" value="发表" />
			<input type="reset" class="label-default" value="取消" />
		</form>
	</div>
</div>
<script type="text/javascript">
	function reply(id,toname) {
		document.getElementById('reply').style.cssText='position: fixed; z-index:100; top:0px; left:0px; width: 100%; height: 100%; display: block; background-color: rgba(255,255,255,0.5);';
		$('#reply h3').text('回复：'+toname);
		$('#reply input[name="comtId"]').val(id);
		$('#reply input[name="toname"]').val(toname);
	}
	$('input[type="reset"]').click(function () {
		$('#comment').hide();
		$('#reply').hide();
	})
</script>